<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>游戏测评 - GAME REVIEW HUB</title>
    <link rel="stylesheet" href="styles.css">
    <link rel="stylesheet" href="reviews.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <link rel="stylesheet" href="auth.css">
    {% load staticfiles %}
</head>
<body>
    <header class="header">
        <div class="logo">
            <h1>GAME REVIEW HUB</h1>
        </div>
        <nav class="nav">
            <a href="../templates/index.html" class="nav-item">首页</a>
            <a href="games.html" class="nav-item">游戏</a>
            <a href="reviews.html" class="nav-item active">测评</a>
            <button class="login-btn" onclick="toggleLogin()">登录</button>
        </nav>
    </header>

    <main class="reviews-container">
        <!-- 测评统计面板 -->
        <div class="stats-panel">
            <div class="stat-item">
                <h3>总测评数</h3>
                <span class="stat-number">1,234</span>
            </div>
            <div class="stat-item">
                <h3>本月热门游戏</h3>
                <span class="stat-text">塞尔达传说</span>
            </div>
            <div class="stat-item">
                <h3>最受好评</h3>
                <span class="stat-text">艾尔登法环</span>
            </div>
            <button class="write-review-btn" onclick="showReviewForm()">
                <i class="fas fa-pen"></i>
                写测评
            </button>
        </div>

        <!-- 筛选器 -->
        <div class="filter-section">
            <div class="search-box">
                <input type="text" placeholder="搜索游戏或测评...">
                <button><i class="fas fa-search"></i></button>
            </div>
            <div class="filter-options">
                <select id="sortBy">
                    <option value="latest">最新发布</option>
                    <option value="popular">最受欢迎</option>
                    <option value="rating">评分最高</option>
                </select>
                <select id="gameType">
                    <option value="all">全部游戏</option>
                    <option value="rpg">角色扮演</option>
                    <option value="action">动作冒险</option>
                    <option value="strategy">策略</option>
                </select>
            </div>
        </div>

        <!-- 测评列表 -->
        <div class="reviews-list">
            <!-- 测评卡片示例 -->
            <div class="review-card">
                <div class="review-header">
                    <div class="user-info">
                        <img src="https://via.placeholder.com/40" alt="用户头像" class="user-avatar">
                        <div class="user-details">
                            <h4>用户名</h4>
                            <span class="review-date">2024-03-15</span>
                        </div>
                    </div>
                    <div class="game-rating">
                        <div class="stars">
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star-half-alt"></i>
                        </div>
                        <span class="rating-score">4.5</span>
                    </div>
                </div>
                <div class="review-content">
                    <div class="game-info">
                        <img src="https://via.placeholder.com/120" alt="游戏封面" class="game-cover">
                        <div class="game-details">
                            <h3>艾尔登法环</h3>
                            <span class="game-meta">动作角色扮演 | FromSoftware</span>
                        </div>
                    </div>
                    <p class="review-text">
                        这是一款非常优秀的游戏，开放世界设计令人惊叹，战斗系统深度十足...
                    </p>
                    <div class="review-actions">
                        <button class="action-btn like-btn">
                            <i class="far fa-thumbs-up"></i>
                            <span>128</span>
                        </button>
                        <button class="action-btn comment-btn">
                            <i class="far fa-comment"></i>
                            <span>36</span>
                        </button>
                        <button class="action-btn share-btn">
                            <i class="far fa-share-square"></i>
                        </button>
                    </div>
                </div>
            </div>
        </div>

        <!-- 分页 -->
        <div class="pagination">
            <button class="prev-page"><i class="fas fa-chevron-left"></i></button>
            <div class="page-numbers">
                <button class="active">1</button>
                <button>2</button>
                <button>3</button>
                <span>...</span>
                <button>10</button>
            </div>
            <button class="next-page"><i class="fas fa-chevron-right"></i></button>
        </div>
    </main>

    <!-- 写测评弹窗 -->
    <div class="review-modal" id="reviewModal">
        <div class="review-form">
            <div class="review-form-header">
                <h2>写测评</h2>
                <button class="close-btn" onclick="hideReviewForm()">×</button>
            </div>
            <div class="form-content">
                <div class="form-group">
                    <label>选择游戏</label>
                    <div class="select-wrapper">
                        <select id="gameSelect" required>
                            <option value="">请选择游戏</option>
                            <option value="1">艾尔登法环</option>
                            <option value="2">塞尔达传说</option>
                            <option value="3">赛博朋克2077</option>
                        </select>
                        <i class="fas fa-chevron-down"></i>
                    </div>
                </div>
                <div class="form-group">
                    <label>游玩平台</label>
                    <div class="select-wrapper">
                        <select id="platform" required>
                            <option value="">请选择平台</option>
                            <option value="PC">PC</option>
                            <option value="PS5">PS5</option>
                            <option value="Xbox">Xbox Series X|S</option>
                            <option value="Switch">Nintendo Switch</option>
                        </select>
                        <i class="fas fa-chevron-down"></i>
                    </div>
                </div>
                <div class="form-group">
                    <label>游戏时长（小时）</label>
                    <input type="number" id="playTime" min="0" placeholder="输入游戏时长" required>
                </div>
                <div class="form-group">
                    <label>获取方式</label>
                    <div class="select-wrapper">
                        <select id="purchaseType" required>
                            <option value="">请选择获取方式</option>
                            <option value="purchase">购买</option>
                            <option value="rent">租赁</option>
                            <option value="subscription">订阅服务</option>
                        </select>
                        <i class="fas fa-chevron-down"></i>
                    </div>
                </div>
                <div class="form-group rating-group">
                    <label>评分</label>
                    <div class="rating-input">
                        <div class="stars">
                            <i class="far fa-star" data-rating="1"></i>
                            <i class="far fa-star" data-rating="2"></i>
                            <i class="far fa-star" data-rating="3"></i>
                            <i class="far fa-star" data-rating="4"></i>
                            <i class="far fa-star" data-rating="5"></i>
                        </div>
                        <span class="rating-text">请选择评分</span>
                    </div>
                </div>
                <div class="form-group">
                    <label>测评内容</label>
                    <textarea 
                        placeholder="分享你的游戏体验（最少100字）..." 
                        required
                        minlength="100"
                        maxlength="1000"
                        rows="8"
                    ></textarea>
                    <div class="word-count">0/1000</div>
                </div>
                <div class="form-group">
                    <label>游戏标签</label>
                    <div class="tags-section">
                        <div class="pros-tags">
                            <h4>优点标签（可多选）</h4>
                            <div class="tag-list">
                                <span class="tag" data-tag="gameplay">玩法出色</span>
                                <span class="tag" data-tag="graphics">画面精美</span>
                                <span class="tag" data-tag="story">剧情优秀</span>
                                <span class="tag" data-tag="music">音乐出众</span>
                                <span class="tag" data-tag="innovation">创新设计</span>
                                <span class="tag" data-tag="optimization">优化出色</span>
                            </div>
                        </div>
                        <div class="cons-tags">
                            <h4>缺点标签（可多选）</h4>
                            <div class="tag-list">
                                <span class="tag" data-tag="bugs">Bug较多</span>
                                <span class="tag" data-tag="price">价格偏高</span>
                                <span class="tag" data-tag="difficulty">难度失衡</span>
                                <span class="tag" data-tag="content">内容不足</span>
                                <span class="tag" data-tag="performance">性能问题</span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label>游戏截图</label>
                    <div class="file-upload-wrapper">
                        <i class="fas fa-cloud-upload-alt upload-icon"></i>
                        <div class="upload-text">点击或拖拽上传截图</div>
                        <div class="upload-tip">支持jpg、png格式，最多5张，每张不超过5MB</div>
                        <input type="file" id="screenshots" multiple accept="image/*" max="5">
                    </div>
                </div>
                <div class="form-group">
                    <label>视频链接（可选）</label>
                    <input type="url" id="videoUrl" class="video-url-input" 
                            placeholder="支持bilibili、youtube等视频平台链接">
                </div>
                <div class="form-group">
                    <label>推荐程度</label>
                    <div class="recommend-options">
                        <label>
                            <input type="radio" name="recommend" value="highly" required>
                            <span>强烈推荐</span>
                        </label>
                        <label>
                            <input type="radio" name="recommend" value="normal">
                            <span>一般推荐</span>
                        </label>
                        <label>
                            <input type="radio" name="recommend" value="not">
                            <span>不推荐</span>
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <label>可见性</label>
                    <div class="visibility-wrapper">
                        <select id="visibility" class="visibility-select" required>
                            <option value="public">公开</option>
                            <option value="friends">仅好友可见</option>
                            <option value="private">仅自己可见</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="form-actions">
                <button class="cancel-btn" onclick="hideReviewForm()">取消</button>
                <button class="submit-btn" onclick="submitReview()">发布测评</button>
            </div>
        </div>
    </div>

    <!-- 添加登录模态框 -->
    <div class="login-modal" id="loginModal">
        <div class="modal-content">
            <div class="modal-header">
                <h2>登录</h2>
                <button class="close-btn" onclick="toggleLogin()">×</button>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <input type="text" placeholder="用户名/手机号" required>
                </div>
                <div class="form-group">
                    <input type="password" placeholder="密码" required>
                </div>
                <div class="form-options">
                    <label>
                        <input type="checkbox"> 记住我
                    </label>
                    <a href="#" class="forgot-password">忘记密码？</a>
                </div>
                <button class="submit-btn">登录</button>
                <div class="switch-auth">
                    还没有账号？<a href="../templates/register.html">立即注册</a>
                </div>
            </div>
        </div>
    </div>
    
    <div class="register-modal" id="registerModal">
        <div class="modal-content">
            <div class="modal-header">
                <h2>创建账号</h2>
                <button class="close-btn" onclick="toggleRegister()">×</button>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <input type="text" placeholder="用户名" required>
                </div>
                <div class="form-group">
                    <input type="password" placeholder="密码" required>
                </div>
                <div class="form-group">
                    <input type="password" placeholder="确认密码" required>
                </div>
                <div class="form-group">
                    <div class="phone-input">
                        <input type="tel" placeholder="手机号码" required>
                        <button class="verify-btn">发送验证码</button>
                    </div>
                </div>
                <div class="form-group">
                    <input type="text" placeholder="短信验证码" required>
                </div>
                <div class="form-group">
                    <div class="captcha-input">
                        <input type="text" placeholder="图形验证码" required>
                        <img src="path/to/captcha.jpg" alt="验证码" class="captcha-img">
                    </div>
                </div>
                <div class="form-options">
                    <label>
                        <input type="checkbox" required>
                        <span>我同意 <a href="#">服务条款</a> 和 <a href="#">隐私政策</a></span>
                    </label>
                </div>
                <button class="submit-btn">注册</button>
                <div class="switch-auth">
                    已有账号？<a href="#" onclick="switchToLogin()">立即登录</a>
                </div>
            </div>
        </div>
    </div>

    <script src="reviews.js"></script>
    <script src="auth.js"></script>
    <script src="script.js"></script>
</body>
</html> 